// 导入请求接口的文件
import axios from "@/utils/requests";


// 获取商品列表接口函数
export const goodsList = (listData) => {
    return axios.get('/goods/list', {
        params: listData
    })
}

/**
 * 获取商品的类型
 * @param {*} goodsType  
 * @returns 
 */
export const goodsTypeReq = (currentPage = 1, pageSize = 9999) => {
    return axios.get('/goods/catelist', {
        params: {
            currentPage,
            pageSize
        }
    })
}

/**
 * 获取商品的类型
 * @param {*} goodsType  
 * @returns 
 */
export const goodsTypeReq1 = (params) => {
    return axios.get('/goods/catelist', {
        params
    })
}

/**
 * 添加商品的接口函数
 * @param {*} goods 
 * @returns 
 */
export const goodsAddReq = (goods) => {
    return axios.post('/goods/add', goods)
}

/**
 * 删除商品接口函数
 * @param {*} removeGoods 
 * @returns 
 */
export const removeGoodsReq = (removeGoods) => {
    return axios.get('/goods/del', {
        params: removeGoods
    })
}

/**
 * 修改商品接口函数
 * @param {*} data 
 * @returns 
 */
export const editGoodsReq = (data) => {
    return axios.post('/goods/edit', data)
}

/**
 * 修改商品分类
 * @param {*} data 
 * @returns 
 */
export const goodsEditReq = (data) => {
    return axios.post('/goods/editcate', data)
}

/**
 * 添加商品分类
 * @param {*} data 
 * @returns 
 */
export const addGoodsTypeReq = (data) => {
    return axios.post('/goods/addcate', data)
}